package com.work.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.work.bean.AreaBean;
import com.work.mapper.AreaMapper;
import com.work.service.IAreaService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class IAreaServiceImpl extends ServiceImpl<AreaMapper, AreaBean> implements IAreaService {
    @Override
    public IPage<AreaBean> findAllArea(int pageNo, int pageSize) {
        Page<AreaBean> page = new Page<>(pageNo,pageSize);
        IPage<AreaBean> iPage = this.page(page);
        this.baseMapper.findAllArea();
        return iPage;
    }

    @Override
    public void addArea(AreaBean area) {
        this.baseMapper.insert(area);
    }

    @Override
    public IPage<AreaBean> findName(int pageNo, int pageSize, String areaName, String areaForestType, String classname) {
        Page<AreaBean> page = new Page<>(pageNo,pageSize);
        IPage<AreaBean> iPage = this.page(page);
        this.baseMapper.findName(areaName,areaForestType,classname);
        return iPage;
    }
}
